package com.bluebridgecup.BasicAlgorithms.oneDimensionPrefixSumAndDifference;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class OneDimDiff {

    static FastReader in = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    // 定义一个较大的常量N，用于数组的大小
    static int N = (int) (2 * 1e5 + 10);
    // 表示序列的长度
    static int n, m;
    // 存储原始序列的数组
    static int[] a = new int[N];
    // 存储差分数组
    static int[] d = new int[N];

    public static void main(String[] args) {

        solve();

        out.flush();
    }

    static void solve() {
        // 从输入中读取序列的长度n和操作的次数m
        n = in.nextInt();
        m = in.nextInt();
        // 读取原始序列，并计算差分数组
        for (int i = 1; i <= n; i++) {
            a[i] = in.nextInt();
            //计算差分数组，d[i]表示相邻元素的差
            d[i] = a[i] - a[i - 1];
        }
        // 进行m次操作
        while (m-- > 0) {
            //读取操作的左右边界l和r，以及增加值k
            int l = in.nextInt(), r = in.nextInt(), k = in.nextInt();
            // 在差分数组中标记起始位置l要增加的值
            d[l] += k;
            //在差分数组中标记结束位置r+1要减少的值
            d[r + 1] -= k;
        }
        //利用差分数组还原最终序列
        for (int i = 1; i <= n; i++) {
            //计算前缀和，得到最终序列元素的值
            d[i] += d[i - 1];
            //输出最终序列元素，元素之间用空格分隔
            out.print(d[i] + " ");
        }
        // 没赋值默认为0
        // out.println(d[1000]);

    }

    static class FastReader {
        static BufferedReader br;
        static StringTokenizer st;

        FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            String str = "";
            while (st == null || !st.hasMoreElements()) {
                try {
                    str = br.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                st = new StringTokenizer(str);
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }

}